package com.lhkj.ct.base.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.IEnum;

/**
 * <p>
 *     数据权限
 * </p>
 */
public enum DataScope implements IEnum<Integer> {

    ALL(0, "全部数据"),
    ORGAN(1, "本机构数据"),
    DEPT_CHILD(2, "部门及子部门数据"),
    DEPT(3, "本部门数据"),
    SELF(4, "本人数据");

    @EnumValue
    private final int code;

    private final String desc;

    DataScope(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    @Override
    public String toString() {
        return String.valueOf(code);
    }

    @Override
    public Integer getValue() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

}
